from rest_framework.viewsets import ModelViewSet
from rest_framework.generics import *
from django.contrib.auth.models import *
from apps.meiduo_admin.serializers.group import *
from apps.meiduo_admin.serializers.permission import PermissionSerializer
from apps.meiduo_admin.utils import PageNum


class GroupModelViewSet(ModelViewSet):
    queryset = Group.objects.all()

    serializer_class = GroupSerializer

    pagination_class = PageNum


class SimplePermissionAPIView(ListAPIView):
    queryset = Permission.objects.all()

    serializer_class = PermissionSerializer   # 使用以前定义的全选序列化器
